<template>
<el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage"
      :page-size="pageSize"
      layout="prev, pager, next, jumper"
      :total="total">
    </el-pagination>
</template>

<script>
export default {
  props:['total','pageSize'],
methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
        this.$parent.pageSize =val
        this.$parent.getData()
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.$parent.page =val

        this.$parent.getData()

      }
    },
    data() {
      return {
        currentPage: 1,
      
      };
    }
}
</script>

<style lang="less">
.el-pagination{
  text-align: center;
}

</style>